@extends('default.layouts.simple_vice_head_foot')
@section('title'){{ $companyinfo->company_name.' - 招聘主页'}} @endsection
@section('insert_css')
    {{--添加样式表--}}
    <link rel="stylesheet" href="{{asset('/default/css/index/vice_public.css')}}">
    <link rel="stylesheet" href="{{asset('/default/css/index/comabout.css')}}">
    <link rel="stylesheet" href="{{asset('/default/css/index/station.css')}}">
@endsection
@section('content')
    {{--副页菜单模版--}}
    @include('default.layouts.index_vice_mune')
    {{--分站列表--}}
    @include('default.layouts.station')
    {{--内容区显示区--}}
    <div class="vicecontent">
        {{--阴影线--}}
        <div class="shadow_line"></div>
        <div class="content_area">
            <div class="job_display border">
                {{--公司图片+标签--}}

                <div class="company_info">
                    <ul>
                        <li class="left"><img src="{{ $companyinfo->logo  }}"></li>
                        <li class="right">
                            <div class="com_top">
                                @if(empty($companyinfo->brands))
                                    <span class="brands">{{$companyinfo->company_name}}</span>
                                @else
                                    <span class="brands">{{$companyinfo->brands}}</span>
                                @endif
                                <span class="share"><a id="toShare"><i></i>分享</a></span>
                                @if( !empty(Site::get('appCompanyHasIOS')) || !empty(Site::get('appCompanyHasAndroid') ) )
                                    <span class="share app_open"><a  onclick="advisory('{{$companyinfo->contacts}}','{{asset($companyinfo->logo)}}')" id="appOpen"><i></i>APP</a></span>
                                @endif
                            </div>
                            <div class="authenticate">
                                <p>
                                    {{ str_limit($companyinfo->company_name,70) }} <span> <img
                                                style="margin-right: 8px; margin-left: 8px;"
                                                src="{{asset("/default/images/icon/newJob_58.png")}}">{{$companyinfo->cn_industry}}
                                        <img style="margin-left: 8px;"
                                             src="{{asset("/default/images/icon/newJob_59.png")}}"></span>
                                    @if($companyinfo->cert_status==0)
                                        <em class="company_s1">未认证</em>
                                    @else
                                        <em class="company_s2">已认证</em>
                                    @endif
                                </p>
                            </div>
                            <div class="remark">
                                <span class="first">( {{$companyinfo->cn_comkind}} | {{$companyinfo->cn_employee_num}}
                                    )</span>
                            </div>
                            <div class="temptation">
                                @if(count($companyinfo->temptation) > 0)
                                    @foreach($companyinfo->temptation as $v)
                                        <i>{{ $v }}</i>
                                    @endforeach
                                @endif
                            </div>
                        </li>
                    </ul>
                </div>
            </div>

            <div class="job_display border">
                {{--left--}}
                <div class="job_display_left">
                    <div class="describe">
                        <div class="title"><em class="sign"></em><label>公司介绍</label></div>
                        <div class="content">
                            {!! nl2br(e($companyinfo->profile)) !!}
                        </div>
                        @if(count($photo)>0)
                            <div id="pic_list_1" class="scroll_horizontal">
                                <div class="box" id="phoneBox">
                                    <ul class="list">
                                        @foreach($photo as $k => $v)
                                            @if(!empty($v))
                                                <li><img layer-src="{{asset('upload/companyphoto/'.$v['file'])}}"
                                                         src="{{asset('upload/companyphoto/'.$v['file'])}}" width="220"
                                                         height="166" alt="{{ $v['remark'] or '' }}"></li>
                                            @endif
                                        @endforeach
                                    </ul>
                                </div>
                            </div>
                        @endif
                    </div>
                    {{--该公司其它职位--}}
                    <div id="handle_ajax">
                        @include('default.layouts.companyAbout')
                    </div>
                </div>{{--end left--}}
                {{--right--}}
                <div class="job_display_right">
                    <div class="contact">
                        <div class="title"><em class="sign"></em><label>联系方式</label></div>
                        <div class="content">
                            <ul>
                                <li class="left">联&nbsp;系&nbsp;人:</li>
                                <li class="right">{{ $companyinfo->contacts }}</li>
                            </ul>
                            <ul>
                                <li class="left">联系电话:</li>
                                <li class="right">{{ $companyinfo->phone or '' }}</li>
                            </ul>
                            <ul>
                                <li class="left">公司网址:</li>
                                <li class="right">{{ $companyinfo->website }}</li>
                            </ul>
                            <ul>
                                <li class="left">电子邮箱:</li>
                                <li class="right">{{ $companyinfo->email }}</li>
                            </ul>
                            <ul>
                                <li class="left">通讯地址:</li>
                                <li class="right">{{ $companyinfo->address }}</li>
                            </ul>
                        </div>
                        <div class="map" id="container">
                            <iframe name="baiduMap" id="baiduMap" width="302" height="230"
                                    src="{{ route("baiduMap",["cid"=>idEncryption($companyinfo->id)]) }}" scrolling="no"
                                    frameborder="0"></iframe>
                        </div>
                    </div>
                </div>{{--end right--}}
            </div>

        </div> {{--end 内容显示--}}

    </div>
    <div class="vicebuttom"></div>
    {{--浮动层--}}
    {{--@include('default.layouts.floating')--}}
@endsection
@section('insert_js')
    <script type="text/javascript"
            src="{{getRequestType()}}://api.map.baidu.com/api?v=2.0&ak={{Site::get('mapKey')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/jquery/jquery.cxscroll.min.js')}}"></script>
    <script>
        $(function(){
            //分享
            $("#toShare").click(function(){
                layer.open({
                    type: 1,
                    title: '分享朋友圈',
                    skin: 'layer-toshare',
                    area: ['240px', '295px'],
                    resize: false,
                    move: false,
                    btn: false,
                    content: '<div><img src="{{url('to_share?com_id='.$companyinfo->id)}}"></div><div style="text-align: center">扫一扫分享到朋友圈</div>'
                });
            });

        });
        /**
         * 跳转的页码
         */
        function location_page(page){
            $.post("/handle_ajax", {
                'companyid': '{{ $companyinfo->id }}',
                'page': page,
                '_token': "{{csrf_token()}}"
            }, function(data){
                $("#handle_ajax").html(data);
            });
        }
        //公司相册
        $("#pic_list_1").cxScroll();
        //点击弹出大图
        layer.ready(function(){
            layer.photos({
                photos: '#phoneBox',
                shift: 5
            });
        });

        function GetXmlHttpObject(){
            var xmlHttp = null;
            try{
                // 谷歌+火狐+Safari+ie8
                xmlHttp = new XMLHttpRequest();
            }
            catch(e){
                //ie
                try{
                    xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
                }
                catch(e){
                    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
            }
            return xmlHttp;
        }

        /**
         *
         * param contact 联系人
         * param logo 公司logo
         */
        function advisory(contacts, logo){
            //手机app下载使证在你那里就身份证在
            @if( !empty(Site::get('appCompanyHasIOS')) || !empty(Site::get('appCompanyHasAndroid') ) )
            var apphtml = '';
            apphtml += '<div class="advisory">';
            apphtml += '<div class="content"><div class="top">';
            apphtml += '<span class="logo"><img src="' + logo + '"></span>';
            apphtml += '<span class="info"><span>HI,我是公司人事' + contacts + '，你对这个公司感兴趣吗？我在{{Site::get('webname')}}APP等你来沟通！</span></span>';
            apphtml += '</div>';

            apphtml += '<div class="appsao">';
            apphtml += '<div class="appimg"><img src="{{ asset('/default/images/index/erweima.png') }}"></div>';
            apphtml += '<div class="appdown">';
            apphtml += '<span class="scanning">APP扫描下方二维码立即聊工作</span>';
            apphtml += '<span class="qcode"><img src="{{ url('app_company_down?com_id='.idEncryption($companyinfo->id)) }}"></span>';
            apphtml += '</div>';
            apphtml += '</div>';

            apphtml += '<div class="bottom">';
            apphtml += '<p>未下载APP，请下载{{Site::get('webname')}}APP<a href="/mobile_help"><i></i></a></p>';
            apphtml += '</div>';

            apphtml += '</div>';
            apphtml += '</div>';

            layer.open({
                type: 1,
                title: "",
                //  skin: 'layui-layer-rim', //加上边框
                area: ['500px'], //宽高
                content: apphtml
            });
            @endif
        }
    </script>
@endsection